package com.mobile.clouree;

import android.app.AlertDialog;
import android.util.Log;

import com.adobe.fre.FREContext;
import com.adobe.fre.FREFunction;
import com.adobe.fre.FREObject;

public class AndroidAneShowDialog implements FREFunction {
   private final static String Tag = "AndroidAneShowDialog ";
	@Override
	public FREObject call(FREContext context, FREObject[] arg1) {
		Log.i(Tag,Tag + "call AndroidshowDialog");
		try {
			FREObject alertInfo = arg1[0];
			String content = alertInfo.getAsString();
			FREObject titleInfo = arg1[2];
			String title = titleInfo.getAsString();
			FREObject buttonInfo = arg1[1];
			String button = buttonInfo.getAsString();
			AlertDialog.Builder alert = new AlertDialog.Builder(context.getActivity());
			alert.setTitle(title)
			.setMessage(content)
			.setNeutralButton(button, null)
			.show();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
		return null;
	}

}
